﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FindAndReplaceVariables.aspx.cs" Inherits="H2.NET.Web.Workflow.Workflow.FindAndReplaceVariables" %>

<script type="text/javascript">

    $(function() {

        $("#tasks", $.pdialog.getCurrent()).change(function() {

            var taskId = $(this).children('option:selected').val();
            if (taskId == "") return;

            $("#taskTable", $.pdialog.getCurrent()).load(
                "<%=Page.ResolveUrl("~/Workflow/TaskVariables.aspx")%>?taskid=" + taskId,
                function() {
                    $("table.table", $.pdialog.getCurrent()).jTable();
                }
            );

            //$(".", $.pdialog.getCurrent())
        });

    });

    function ajaxReplace()
    {
        var storeID = $("[name=BlankVlue]").val();
        alert($("[name=BlankVlue]").val());
        $.ajax({
            type: 'POST',
            url: '<%=Page.ResolveUrl("~/pages/smd/ajaxtools/handler.ashx?action=getStepUName")%>',
            data: { storeid: storeID },
                dataType: "json",
                cache: false,
                success: function (json) {
                    alert(json);
                }
        });
    }
</script>

        <form id="Form1" runat="server" method="post" action="Workflow/FindAndReplaceVariables.aspx?action=save" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone, '确定要保存修改吗？');">
           
<div class="page">
    <div class="pageContent">
        <div class="pageHeader" style="border-left-width: 0px; border-right-width: 0px;">
            <select id="tasks" name="tid">
                <option value="">--请选择步骤--</option>
                <asp:repeater id="gvTasks" runat="server">
                <ItemTemplate>
                    <option value="<%# Eval("taskId")%>"><%# Eval("taskName")%></option>
                </ItemTemplate>
                </asp:repeater>
            </select>
            <label><input type="checkbox" name="isReplaceAll" value="true"/>替换全部激活步骤的变量</label>
            <input type="button" value="ajax替换" onclick="ajaxReplace()">
            <%--<label><input type="checkbox" name="isReplaceMain" value="true"/>替换Main的变量</label>--%>
        </div> <div class="pageFormContent" style="padding: 0px;">
                
                <div id="taskTable"  layouth="79">
                <table class="table" width="100%">
                    <thead>
                        <tr>
                            <th width="200">变量名</th>
                            <th>变量值</th>
                        </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
                </div>
            </div>
            <div class="formBar">
                <ul>
                    <li>
                        <div class="buttonActive">
                            <div class="buttonContent">
                                <button type="submit">
                                    确认修改</button>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="button">
                            <div class="buttonContent">
                                <button type="button" class="close">
                                    关闭窗口</button>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
    </div>
</div>
        </form>
